<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use common\widgets\ActiveField;

/* @var $this yii\web\View */
/* @var $model common\models\Menu */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="ibox-content">

    <?php $form = ActiveForm::begin([
        'fieldClass' => ActiveField::className(),
        'layout' => 'horizontal',
        'fieldConfig' => [
            'template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}",
            'horizontalCssClasses' => [
                'label' => 'col-sm-2',
                'offset' => 'col-sm-offset-2',
                'wrapper' => 'col-sm-10',
                'error' => '',
                'hint' => '',
            ],
        ],
    ]); ?>

    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
    <div class="hr-line-dashed"></div>
    <?= $form->field($model, 'parent_id')->select() ?>
    <div class="hr-line-dashed"></div>
    <?= $form->field($model, 'icon')->textInput(['maxlength' => true]) ?>
    <div class="hr-line-dashed"></div>
    <?= $form->field($model, 'controller')->textInput(['maxlength' => true]) ?>
    <div class="hr-line-dashed"></div>
    <?= $form->field($model, 'action')->textInput(['maxlength' => true]) ?>
    <div class="hr-line-dashed"></div>
    <?= $form->field($model, 'params')->textInput(['maxlength' => true]) ?>
    <div class="hr-line-dashed"></div>
    <?= $form->field($model, 'auth_item')->textInput(['maxlength' => true]) ?>
    <div class="hr-line-dashed"></div>
    <?= $form->field($model, 'status')->radioList([
        $model::STATUS_DELETE => '禁用',
        $model::STATUS_ACTIVE => '启用',
    ]) ?>

    <div class="form-group">
        <div class="col-sm-4 col-sm-offset-2">
            <?= Html::resetButton('重置', ['class' => 'btn btn-white']) ?>
            <?= Html::submitButton('保存', ['class' => 'btn btn-primary']) ?>
        </div>
    </div>

    <?php ActiveForm::end(); ?>

</div>
